//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.starcard;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import org.come.Frame.TestpackJframe;
import org.come.Frame.ZhuFrame;
import org.come.entity.Goodstable;
import org.come.until.GoodsListFromServerUntil;
import org.come.until.MessagrFlagUntil;

public class MouseListenerSoulBack extends MouseAdapter {
    private int i;
    private JpanelSoulBackMain jpanelSoulBackMain;

    public MouseListenerSoulBack(int i, JpanelSoulBackMain jpanelSoulBackMain) {
        this.i = i;
        this.jpanelSoulBackMain = jpanelSoulBackMain;
    }

    @Override
    public void mousePressed(MouseEvent e) {
        Goodstable starCardGoods = GoodsListFromServerUntil.getStarCardGoods(this.i);
        if (starCardGoods != null && this.jpanelSoulBackMain != null) {
            if (starCardGoods.getStatus() == 1) {
                ZhuFrame.getZhuJpanel().addPrompt2("该星卡已装备，无法魂归");
                return;
            }

            if (starCardGoods.getGoodlock() == 1) {
                ZhuFrame.getZhuJpanel().addPrompt2("该星卡已上锁，无法魂归");
                return;
            }

            this.jpanelSoulBackMain.addListNum(starCardGoods);
        }

    }

    @Override
    public void mouseEntered(MouseEvent e) {
        Goodstable goodstable = GoodsListFromServerUntil.getStarCardGoods(this.i);
        if (goodstable != null) {
            ZhuFrame.getZhuJpanel().creatgoodtext(goodstable);
            MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE12);
        }

    }

    @Override
    public void mouseExited(MouseEvent e) {
        MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
        TestpackJframe.getTestpackJframe().getJpac().ClearText();
        ZhuFrame.getZhuJpanel().cleargoodtext();
    }
}
